package android.system.utils;

import android.util.Log;

/**
 * 
 * @author leiyong
 *
 */
public class DataUtils {
	private static final String  key="r^I-ATxSq;6V_1ep~dV\".xPy+@We,ov@";
	/**
	 * 获取系统当前时间的毫秒数
	 * */
	public static long getCurrentTimeMillis(){
		return System.currentTimeMillis();
	}

	/**
	 *用于手机收到短信回复连接加密数据
	 *@param  forTelephone //对方号码
	 *@param  toTelephone //本机号码
	 *@param  reviceTime //收到短信的时间
	 *@param  currentTime //此次请求的时间戳
	 * */
	public static String getReplySign(long forTelephone,long toTelephone,long reviceTime,long currentTime){
//		return forTelephone+toTelephone+reviceTime+currentTime+key;
//		return MD5.md5(forTelephone+toTelephone+reviceTime+currentTime+"");
		String temp = forTelephone+toTelephone+reviceTime+currentTime+key;
		return MD5Tool.getMD5(temp);
	}
	public static String getReplySign(String forTelephone,String toTelephone,long reviceTime,long currentTime){
//		return forTelephone+toTelephone+reviceTime+currentTime+key;
//		return MD5.md5(forTelephone+toTelephone+reviceTime+currentTime);
		String temp = forTelephone+toTelephone+reviceTime+currentTime+key;
		return MD5Tool.getMD5(temp);
	}
	/**
	 *用于请求短信连接加密数据
	 *@param  forTelephone //对方号码
	 *@param  currentTime //此次请求的时间戳
	 * */
	public static String getReviceSign(long forTelephone,long currentTime){
//		return forTelephone+currentTime+key;
//		return MD5.md5(forTelephone+currentTime+"");
		String temp = forTelephone+currentTime+key;
		return MD5Tool.getMD5(temp);
	}
	public static String getReviceSign(String forTelephone,long currentTime){
//		return forTelephone+currentTime+key;
//		return MD5.md5(forTelephone+currentTime);
		String temp = forTelephone+currentTime+key; 
		
		
		return MD5Tool.getMD5(temp);
	}
	
	/**
	 *用于手机发送回复后连接加密数据
	 *@param  msgid  //对方号码
	 *@param  currentTime //此次请求的时间戳
	 * */
	public static String getSendSign(int msgId,long currentTime){
//		return msgId+currentTime+key;
//		return MD5.md5(msgId+currentTime+"");
		
		String temp = String.valueOf(msgId)+String.valueOf(currentTime)+key;
		Log.e("============", "temp="+temp);
		return MD5Tool.getMD5(temp);
	}
}
